package com.slz3.business.module.socialManagement.socSign.service;

import com.slz3.business.frame.module.Repositorys;
import com.slz3.business.module.socialManagement.socSign.domain.SocSign;
import com.slz3.business.module.socialManagement.socSign.domain.SocSignFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Slf4j
@Service
public class SocSignTransactionalServiceImpl implements SocSignTransactionalService {

    @Override
    public SocSign modify(SocSign socSignNew) {
        Repositorys.socSign.test();
        Repositorys.socSign.save(SocSignFactory.initBaseFields());
        System.err.println(1/0);
        socSignNew.setLastModifyTime(LocalDateTime.now());
        return Repositorys.socSign.saveAndFlush(socSignNew);
    }

    @Override
    public List<SocSign> batchModify(List<SocSign> socSignList) {
        return Repositorys.socSign.saveAll(socSignList);
    }
}
